﻿$(function () {

    function ViewModel() {
        this.userName = ko.observable("");
        this.PassWord = ko.observable("");
    }
    var user = {
        UserName: this.userName,
    };
    this.create = function () {
        $.ajax({
            type: "POST",
            url: "/Account/LogIn",
            data: ko.toJSON(user),
            //Convert the Observable Data into JSON
            contentType: "application/json",
            success: function (data) {
                alert(data.toString());
            },
            error: function () {
                alert("Failed");
            }
        });
    };
    ko.applyBindings(ViewModel());
});